<template>
	<view class="">
		<view class="list_box">
			<view class="list-cell b-b" @tap="navTo('/pages/center/groundPromot/groundPromot?type=1')" hover-class="cell-hover"
			 :hover-stay-time="50">
				<view class="cell-left">
					<image src="/static/images/center/icon/7.png" mode=""></image>
					<text class="cell-tit">商户收款码</text>
				</view>
				<view class="cell-right">
					<text class="cell-more yticon icon-you"></text>
				</view>
			</view>
			<view class="list-cell b-b" @tap="navTo('/business/walletBill/walletBill')" hover-class="cell-hover"
			 :hover-stay-time="50">
				<view class="cell-left">
					<image src="/static/images/center/icon/1.png" mode=""></image>
					<text class="cell-tit">钱包账单</text>
				</view>
				<view class="cell-right">
					<text class="cell-more yticon icon-you"></text>
				</view>
			</view>
			<view class="list-cell b-b" @tap="nowSignTo" hover-class="cell-hover" :hover-stay-time="50">
				<view class="cell-left">
					<image src="/static/images/center/icon/8.png" mode=""></image>
					<text class="cell-tit">当前签约比例</text>
				</view>
				<view class="cell-right">
					<text class="cell-more yticon icon-you"></text>
				</view>
			</view>
			<view class="list-cell b-b" @tap="navTo('/business/myPromote/myPromote')" hover-class="cell-hover" :hover-stay-time="50">
				<view class="cell-left">
					<image src="/static/images/center/icon/2.png" mode=""></image>
					<text class="cell-tit">商户推广</text>
				</view>
				<view class="cell-right">
					<text class="cell-more yticon icon-you"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		sellerIndex,
		sellerCheckmodify
	} from '@/api/merchant.js'
	export default {
		data() {
			return {
				sellerInfo: {}
			}
		},
		created() {
			sellerIndex().then(res => {
				this.sellerInfo = res.data.seller_info;
			});
		},
		methods: {
			nowSignTo() {
				sellerCheckmodify().then(res => {
					if (res.data.status == 'CHECKING') {
						return uni.showToast({
							duration: 1000,
							title: res.msg,
							icon: 'none'
						})
					}
					if (res.data.status == 'UNCHECK') {
						return uni.navigateTo({
							url: './changeFail?from=signChange' + '&ratio=' + this.sellerInfo.rebate_proportion + '&msg=' + res.data.result.msg
						})
					}
					uni.navigateTo({
						url: `/business/nowSignScale/nowSignScale?ratio=${this.sellerInfo.rebate_proportion}`
					})
				})
			},
			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},

		}
	}
</script>

<style lang="scss" scoped>
	.list_box {
		background-color: #fff;
		padding: 0 54rpx;
		border-radius: 8rpx;

		.list-cell {
			font-size: 26rpx;
			position: relative;
			display: flex;
			justify-content: space-between;
			line-height: 83rpx;

			&.cell-hover {
				background: #fafafa;
			}

			.cell-left {
				display: flex;
				align-items: center;

				image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 20rpx;
				}

				text {
					font-size: 26rpx;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
				}
			}

			.cell-right {
				color: #E5E5E5;
			}
		}
	}
</style>
